﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;

namespace Cloak.Mvp
{
	/// <summary>
	/// Describes the binding of a presenter type to a view type
	/// </summary>
	[ContractClass(typeof(IPresenterDeclarationContract))]
	public interface IPresenterDeclaration
	{
		/// <summary>
		/// Gets a reference to the presenter declaratively bound to the view
		/// </summary>
		/// <returns>The presenter declaratively bound to the view</returns>
		IPresenterReference GetReference();
	}

	[ContractClassFor(typeof(IPresenterDeclaration))]
	internal abstract class IPresenterDeclarationContract : IPresenterDeclaration
	{
		IPresenterReference IPresenterDeclaration.GetReference()
		{
			Contract.Ensures(Contract.Result<IPresenterReference>() != null);

			return null;
		}
	}
}